class Solution:
    def reverseStr(self, s: str, k: int) -> str:
        strs = list(s)

        def reverse(strs):
            l, r = 0, len(strs)-1
            while l < r:
                strs[l], strs[r] = strs[r], strs[l]
                l += 1
                r -= 1
            return strs

        for x in range(0, len(s), 2*k):
            strs[x:x+k] = reverse(strs[x:x+k])

        return "".join(strs)